/*
 * @Description: 
 * @Author: fhw
 * @Date: 2022-11-18 17:17:03
 */
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
import { IsArray, IsDefined, IsNotEmpty, IsString } from 'class-validator'
import { IdDto, PageDto } from '../../common/dto/dto'
export class GetChatGroupPage extends PageDto {
    @ApiPropertyOptional({
        type: String,
        name: 'group_id',
        description: '群id',
    })
    public group_id?: string

    @ApiPropertyOptional({
        type: String,
        name: 'groupChatName',
        description: '群名称',
    })
    public groupChatName?: string

    @ApiPropertyOptional({
        type: Number,
        name: 'managerId',
        description: '群主ID',
    })
    public managerId?: number

}
export class CreateChatGroupDto {
    @IsNotEmpty({ message: '用户Id集合不能为空' })
    @IsArray({ message: '用户Id集合不是数组' })
    @ApiProperty({
        type: Array,
        name: 'userIds',
        description: '用户Id集合',
    })
    public readonly userIds: Array<number>

    @IsNotEmpty({ message: '群主id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'manager_id',
        description: '群主id',
    })
    public readonly manager_id: number

    @IsNotEmpty({ message: '群名称不能为空' })
    @ApiProperty({
        type: String,
        name: 'name',
        description: '群名称',
    })
    public readonly name: string
}
export class UpdateGroupChatDto {
    @IsNotEmpty({ message: 'manager_id不能为空' })
    @ApiProperty({
        type: Number,
        name: 'manager_id',
        description: '群主id',
    })
    public readonly manager_id: number

    @IsNotEmpty({ message: 'group_id不能为空' })
    @ApiProperty({
        type: String,
        name: 'group_id',
        description: '群Id',
    })
    public readonly group_id: string

    @IsNotEmpty({ message: '名称不能为空' })
    @ApiProperty({
        type: String,
        name: 'name',
        description: '群名称',
    })
    public readonly name: string

    @ApiPropertyOptional({
        type: String,
        name: 'announcement',
        description: '公告',
    })
    public announcement?: string

    @ApiPropertyOptional({
        type: String,
        name: 'group_portrait',
        description: '头像',
    })
    public group_portrait?: string
}
export class DeleteChatGroupDto {
    @IsNotEmpty({ message: '群ID不能为空' })
    @ApiProperty({
        type: String,
        name: 'group_id',
        description: '群ID',
    })
    public readonly group_id: string

    @ApiPropertyOptional({
        type: Number,
        name: 'managerId',
        description: '群主id',
    })
    public readonly managerId?: number
}

export class UpdateGroupChatRecordLatestNewsDto {
    @IsDefined({ message: '群聊ID不能为空' })
    @IsNotEmpty({ message: '群聊ID不能为空' })
    @IsString({ message: '群聊ID不是String类型' })
    @ApiProperty({
        type: String,
        name: 'group_id',
        description: '群聊ID',
    })
    public readonly group_id: string
  }